package com.treehouse.northlight.component;

import com.artemis.Component;

/**
 * Component Class
 * 
 * Used for Double attributed components like stats.
 * 
 * @author Julian Biermann
 * @version 1.0 	03.03.2013
 * 
 */
public class IntegerAttribute extends Component {

	private String attributeName;
	private int value;

	/**
	 * Gives the attribute a name and sets the value to 0.
	 * 
	 * @param attributeName
	 *            Name of the attribute.
	 */
	public IntegerAttribute(String attributeName) {
		this.attributeName = attributeName;
		this.value = 0;
	}

	/**
	 * Sets the name and the value of the attribute.
	 * 
	 * @param attributeName
	 *            Name of the attribute.
	 * @param value
	 *            Initial value of the attribute.
	 */
	public IntegerAttribute(String attributeName, int value) {
		this(attributeName);
		this.value = value;
	}

	/**
	 * @return attributeName as String
	 */
	public String getAttributeName() {
		return attributeName;
	}

	/**
	 * @param attributeName
	 *            the attributeName to set
	 */
	public void setAttributeName(String attributeName) {
		this.attributeName = attributeName;
	}

	/**
	 * @return value as int
	 */
	public int getValue() {
		return value;
	}

	/**
	 * @param value
	 *            the value to set
	 */
	public void setValue(int value) {
		this.value = value;
	}

	/**
	 * Add a given value to the stored value amount.
	 * 
	 * @param amount
	 *            Value to be added.
	 */
	public void addToValue(int amount) {
		this.value += amount;
	}

}
